package com.shop.cereshop.app.dl.logic.service.Impl;

import com.shop.cereshop.app.dao.dl.CareShopNewsForwardLogMapper;
import com.shop.cereshop.app.dao.dl.CareShopNewsViewLogMapper;
import com.shop.cereshop.app.dao.dl.CereBuyerUserMapper;
import com.shop.cereshop.app.dao.dl.CereProductSkuMapper;
import com.shop.cereshop.app.dl.logic.domain.CereBuyerUser;
import com.shop.cereshop.app.dl.logic.domain.CereProductSku;
import com.shop.cereshop.app.dl.logic.domain.CereShopProduct;
import com.shop.cereshop.app.dl.logic.service.DlBuyerUserService;
import com.shop.cereshop.app.dl.logic.utils.ResultInfo;
import com.shop.cereshop.app.dl.logic.vo.Statistics;
import com.shop.cereshop.commons.domain.order.CereShopOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @program: dlshop
 * 描述：
 * @author: 我好帅
 * @create: 2021-06-16 10:14
 **/
@Service
@Transactional
public class DlBuyerUserServiceImpl implements DlBuyerUserService {
    @Autowired
    private CereBuyerUserMapper buyerUserMapper;

    @Autowired
    private CareShopNewsForwardLogMapper careShopNewsForwardLogMapper;
    @Autowired
    private CareShopNewsViewLogMapper careShopNewsViewLogMapper;
    @Autowired
    private CereProductSkuMapper cereProductSkuMapper;

    @Override
    public ResultInfo getForwardNewsCount(Long buyerUserId) {
        Statistics s = new Statistics();
        //查询转发数
        s.setForwardingNumber(careShopNewsForwardLogMapper.getForwardCountByBuyerUserId(buyerUserId));
        //查询阅读数
        s.setPageview(careShopNewsViewLogMapper.getViewCountByBuyerUserId(buyerUserId));
        return new ResultInfo(s);
    }

}
